<?php


class Test {

    // public readonly int $id;
    // public readonly ?stirng $name ;

    // public function __construct(int $id, string|null $name) {

    //     $this->id = $id;
    //     $this->name = $name;
    // }

    // 子类可以重新定义
    // public const MAX_POINT = 8080;

    // 最终版本 子类也不可以重新定义
    public final const MAX_POINT = 8080;

    // 我比较喜欢这种更简单
    public function __construct(public readonly int $id , public readonly ?string $name){}

}


$obj = new Test(1,'yy');
echo $obj->id;
echo $obj->name;

spl_autoload_register(function ($name) {
    var_dump($name);
});

class Foo implements ITest {
}





